package com.qf.eduadmin.controller;

import com.qf.eduadmin.pojo.resp.ResponseData;
import com.qf.eduadmin.utils.UploadUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author Mr.Liu
 * @date 2021/12/25 20:43
 */
@RestController
public class UploadController {
    @Autowired
    private UploadUtils uploadUtils;
    @RequestMapping("/upload")
    public ResponseData upload(@RequestParam("file")MultipartFile multipartFile){
        String upload = uploadUtils.upload(multipartFile);
        return new ResponseData(0,"上传成功",upload,null);
    }
}
